package com.personal.enums;

/**
 * @author coderFu
 * @create 2021/10/1
 *通用返回枚举
 */
public enum UserEnum implements Code {

    /** 用户 */
    USERNAME_IS_NULL(1001,"用户名不能为空"),
    USERNAME_EXIST(1002,"用户名已经存在"),
    PASSWORD_LEN_LONGER(1003,"密码长度不能小于6"),
    USER_OR_PASSWORD_ERROR(1004,"用户名或者密码错误"),
    REGIST_PARAMETER_IS_NULL(1005,"请检查用户名，密码，邮箱，验证码是否填写"),
    EMAIL_IS_NULL(1006,"邮箱不能为空"),
    EMAIL_FORMAT_NOT_TRUE(1007,"邮箱格式不正确"),
    USERNAME_OR_PASSWORD_IS_NULL(1008,"用户名或密码不能为空"),
    USER_IS_NULL(1009,"用户不存在，请先注册"),
    EMAIL_IS_EXIST(1010,"邮箱已经存在了，请直接登录"),
    EMAIL_CODE_ERROR(1011,"邮箱验证码不合法"),
    USER_ID_IS_ERROR(1012,"用户id不合法")
    ;

    private int code;
    private String msg;
    UserEnum(int code, String msg){
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String msg() {
        return this.msg;
    }
}
